package org.example.backend.demos.web.UserModule.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.backend.demos.web.UserModule.entity.User;

@Mapper
public interface UserDao extends BaseMapper<User> {

    /**
     * 根据用户名查询用户
     */
    User selectByUsername(@Param("username") String username);

    /**
     * 检查用户名是否存在
     */
    Boolean existsByUsername(@Param("username") String username);

    /**
     * 检查手机号是否存在
     */
    Boolean existsByPhone(@Param("phone") String phone);
}